// yarn add redux react-redux -S
import { createStore } from 'redux'

const reducer = (state = {
  list: [1, 2, 3],
  a: '1111'
}, { type, payload }) => {
  switch (type) {
    case 'UPDATE_LIST':
      return Object.assign({}, state, { list: payload })
    default:
      return state
  }
}

const store = createStore(reducer)

export default store